package com.acme.task3;

public class Task3Arrays {
	public static void main(String[] args) {
        int[] array = new int[50];
        // XXX [MY] Init and process procedure should be separated
        //I don't think that's necessary in this task but OK

		for (int i = 1; i <= 50; i++) {
            if (i % 3 == 0) {
			    System.out.println(String.format("Число %s кратно трем", i));
            }
		}

        for (int i = 0; i < array.length; i++) {
            array[i] = i + 1;
        }
        double avgArr = averageOfArray(array);
        System.out.println(String.format("Среднее значение массива = %s", avgArr));
		
	}

    static double averageOfArray(int[] array) {
        double result = 0;
        for (int i : array) {
            result += i;
        }
        if (array.length > 0) {
            result /= array.length;
        }
        return result;
    }
}
